Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix notifications on list of primitive mixed #4770

Merged
merged 3 commits into from
Jun 23, 2021
Merged

Conversation

ironage
Copy link
Contributor

@ironage ironage commented Jun 17, 2021

We forgot to handle list of Mixed when checking for deep changes in the notification logic.
It's the same code as Set so I extracted it to a templated method. It couldn't be generalized to work on a CollectionBase pointer because this base class doesn't have an iterator interface at that level, and unfortunately it is not trivial to add.

Reported by #4767

☑️ ToDos

  • 📝 Changelog update
  • 🚦 Tests (or not relevant)

@ironage ironage requested review from tgoyne and jedelbo June 17, 2021 19:57
@ironage ironage self-assigned this Jun 17, 2021
@tgoyne
Copy link
Member

tgoyne commented Jun 17, 2021

There are a bunch of things in the DeepChangeChecker tests in transaction_log_parsing.cpp which should be copied to also test this scenario.

Comment on lines 116 to 126
if (value.is_type(type_TypedLink)) {
auto link = value.get_link();
if (!link.is_unresolved()) {
if (!cached_linked_table || cached_linked_table->get_key() != link.get_table_key()) {
cached_linked_table = coll->get_table()->get_parent_group()->get_table(link.get_table_key());
REALM_ASSERT_EX(cached_linked_table, link.get_table_key().value);
}
return this->check_row(*cached_linked_table, link.get_obj_key().value, depth + 1);
}
}
return false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this part of the function is shared between list/set/dictionary and could be extracted to a templated function?

@jedelbo jedelbo force-pushed the js/observe-list-mixed branch from c79c340 to 8b67efd Compare June 18, 2021 11:55
@ironage ironage requested a review from tgoyne June 18, 2021 20:01
@DominicFrei
Copy link
Contributor

Can you have a look at #4646 ? I changed the DeepChangeChecker almost completely and I'm not sure which way the merge might be easier. 🙈

@fealebenpae fealebenpae linked an issue Jun 21, 2021 that may be closed by this pull request
@jedelbo
Copy link
Contributor

jedelbo commented Jun 22, 2021

I think it would be fair if #4646 is merged first - assuming this can be done soon.

@ironage
Copy link
Contributor Author

ironage commented Jun 23, 2021

Looks like we will be doing another v11 release before merging things to master so I will get this in now so it can be included in that.

@ironage ironage merged commit 4cec443 into v11 Jun 23, 2021
@ironage ironage deleted the js/observe-list-mixed branch June 23, 2021 17:35
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crash on RealmList<RealmAny> updates observing
4 participants